
public class Main {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        System.out.print("前序："+" ");
        binaryTree.preOrder(root);
        System.out.println();

        System.out.print("中序："+" ");
        binaryTree.inOrder(root);
        System.out.println();

        System.out.print("后序："+" ");
        binaryTree.postOrder(root);
        System.out.println();

        binaryTree.size(root);
        System.out.println("节点个数："+ BinaryTree.nodeSize);
        System.out.println("节点个数："+ binaryTree.size2(root));

        binaryTree.getLeafNodeCount1(root);
        System.out.println("叶子节点个数："+ BinaryTree.leafSize);
        System.out.println("叶子节点个数："+ binaryTree.getLeafNodeCount2(root));

        System.out.println("第3层节点的个数："+ binaryTree.getKLevelNodeCount(root,3));

        System.out.println("二叉树的高度："+ binaryTree.getHeight(root));


        System.out.println("value的元素是否存在："+ binaryTree.find(root,'B').val);

    }
}